<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%  
response.setHeader("Access-Control-Allow-Origin", "*");  
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>医院大全·数据工厂</title>
	<link href="${pageContext.request.contextPath }/img/webLogoIcon.png" rel="shortcut icon">
    <link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/css/font-awesome.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/css/style.css" rel="stylesheet">
    <!-- FooTable -->
    <link href="${pageContext.request.contextPath }/css/footable.core.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/mypage.css" rel="stylesheet">
</head>
<body>
    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <%request.setAttribute("LEFT", "hospital");%>
            <%@include file="../components/left.jsp"%>
        </nav>
        <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom m-b-20">
		<jsp:include page="../components/head.jsp" flush="true" />
        </div>
        <div class="row wrapper border-bottom white-bg page-heading">
            <div class="col-lg-9">
                <h2>医院大全</h2>
                <ol class="breadcrumb">
                	<li class="nav-main1">
                		<a href="${pageContext.request.contextPath}/admin/tosystem_overview">主页</a>
                	</li>
                	<li class="nav-main2" >
                		<a id="navigation1" href="#" >医疗健康</a>
                	</li>
                	<li class="active">
                		<a>医院大全</a>
                	</li>
               	</ol>
            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                <div class="ibox float-e-margins barcontent" id="barcontent"></div>
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                        <div class="input-select" style="margin-bottom: 20px">
	                               		<div class="input-selectbox">
                                            <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle" type="button"  aria-expanded="false">
                                            <i class="fa fa-bars"></i>
                                            <span id="inputSelected">全部</span></button>
                                            <ul class="dropdown-menu" id="selectlist">
                                            	<li><a onclick="setselect(this)">全部</a></li>
                                                <li><a onclick="setselect(this)">医院名称</a></li>
                                                <li><a onclick="setselect(this)">地区</a></li>
                                                  <li><a onclick="setselect(this)">医院等级</a></li>
                                            </ul>
	                                        <input type="text" class="form-control" style="width:440px;padding-right: 42px;">
	                                        <i id="gosearch" class="fa fa-search cursearch" onclick="search()"></i>
	                                    </div>
	                                </div>
                            <div class="row m-t-sm">
                                <div class="col-lg-12">
                                <div class="panel blank-panel">
                                <div class="panel-body">
                                <div class="tab-content">
                                <div class="tab-pane active" id="tab-1">
                                
                                    <div class="feed-activity-list" id="list">
                                    
<!-- 	                                    <div class="feed-element"> -->
	                                    	
<!-- 						                   	<div class="search-result" style="display: flex;"> -->
<!-- 						                   		<div> -->
<!-- 						                   			<img style="width:150px;" src="https://img.99.com.cn/99/hospital/191328242.jpg" > -->
<!-- 						                   		</div> -->
<!-- 							                   	<div style="padding:0 10px;"> -->
<!-- 							                   		<h3><a target="_blank" href="#">河北大学附属医院</a></h3> -->
<!-- 							                   		<br /> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span style="margin-right: 30px;">采集时间: 2020-02-14 15:23:39</span> -->
<!-- 							                   		</p> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span style="margin-right: 30px;">医院别名: 河北省职工医学院附属医院</span> -->
<!-- 							                   			<span style="margin-right: 30px;">医院等级: 三级甲等</span> -->
<!-- 							                   			<span style="margin-right: 30px;">医院类型: 综合医院</span> -->
<!-- 							                   			<span style="margin-right: 30px;">建院年份: 1910</span> -->
<!-- 							                   			<span style="margin-right: 30px;">综合得分: 7</span> -->
<!-- 							                   			<span style="margin-right: 30px;">医疗水平: 7</span> -->
<!-- 							                   			<span style="margin-right: 30px;">医院服务: 7</span> -->
<!-- 							                   		</p> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span style="margin-right: 30px;">负责人: 张海松</span> -->
<!-- 							                   			<span style="margin-right: 30px;">经营方式: 公立</span> -->
<!-- 							                   			<span style="margin-right: 30px;">邮编: 71000</span> -->
<!-- 							                   			<span style="margin-right: 30px;">是否医保: 是</span> -->
							                   			
<!-- 							                   			<span style="margin-right: 30px;">省: 河北省</span> -->
<!-- 							                   			<span style="margin-right: 30px;">市: 保定市</span> -->
<!-- 							                   			<span style="margin-right: 30px;">区: 东城区</span> -->
<!-- 							                   		</p> -->
<!-- 							                   		<p>简介: 河北大学附属医院坐落在河北省保定市，是一所集医疗、教学、科研、预防保健、康复功能为一体的三级甲等综合医院，国家爱婴医院。</p> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span>荣誉: 北京军区空军机关医院是解放军第二军医大学、第三军医大学、武汉大学医学院的临床教学医院，1995年被北京市确定为首批医疗保险定点医院。建院以来，医院先后荣获“北京市医保定点医院”、“北京空军计划生育优生优育技术指导中心”、“首都规范化服务达标一级医院”、“全国诚信医疗服务单位”、“首都军民共建先进单位”、“中国健康扶贫工程爱心医院”、“诚信示范医院”等荣誉称号。  </span> -->
<!-- 							                   		</p> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span style="margin-right: 30px;">床位数: 2300</span> -->
<!-- 							                   			<span style="margin-right: 30px;">员工数: 3296</span> -->
<!-- 							                   			<span style="margin-right: 30px;">科室数量: 3296</span> -->
<!-- 							                   			<span style="margin-right: 30px;">门诊量(日): 1652</span> -->
<!-- 							                   			<span style="margin-right: 30px;">就诊价格: 1652</span> -->
<!-- 							                   		</p> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span style="margin-right: 30px;">医院设备: X-刀、直线加速器、DSA、螺旋CT、MRI、彩超、胶囊内镜、全自动生化仪</span> -->
<!-- 							                   		</p> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span style="margin-right: 30px;">医院科室: 心血管内科、神经内科、呼吸内科、消化内科、血液内科、泌尿内科</span> -->
<!-- 							                   		</p> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span style="margin-right: 30px;">电话: 0312-5981608;5981555</span> -->
<!-- 							                   			<span style="margin-right: 30px;">邮箱: hdfybg@vip.ina.com</span> -->
<!-- 							                   			<span style="margin-right: 30px;">医院地址: 保定市莲池区裕华东路212号</span> -->
<!-- 							                   		</p> -->
<!-- 							                   		<p> -->
<!-- 							                   			<span style="margin-right: 30px;">乘车路线: 公交：【北京站】到北京军区空军机关医院的乘车路线：步行至北京站东站{300米}，乘坐122路，674，434，在光明桥站下车。步行到医院{80米}。【北京西站】到北京军区空军机关医院的乘车路线：步行至北京西站{230米}，乘坐52路，在光明桥下车{14站}步行至光明医院{390米}【北京南站】到北京军区空军机关医院的乘车路线：步行至陶然亭公园南站{940米}，乘坐特12外，或者{122路，特12内}在光明桥下车{12站}步行至医院80米【</span> -->
<!-- 							                   		</p> -->
<!-- 							                   	</div> -->
<!-- 						                   </div> -->
<!-- 						                 </div> -->
                                    
                                    </div>
                                    <div class="feed-activity-list" id="logs">
                                    	<div class="box" id="box" style="float: right;"></div>
                                    </div>
                                </div>
                                </div>
                                </div>
                                </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
        </div>
        </div>
		<jsp:include page="../components/footer.jsp" flush="true" />
        </div>
        </div>
    <!-- Mainly scripts -->
    <script src="${pageContext.request.contextPath }/js/jquery-2.1.1.js"></script>
    <script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath }/js/jquery.metisMenu.js"></script>
    <script src="${pageContext.request.contextPath }/js/jquery.slimscroll.min.js"></script>
    <!-- Custom and plugin javascript -->
    <script src="${pageContext.request.contextPath }/js/inspinia.js"></script>
    <script src="${pageContext.request.contextPath }/js/pace.min.js"></script>
    <!-- FooTable -->
    <script src="${pageContext.request.contextPath }/js/footable.all.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/mypage.js"></script>
    <!-- Page-Level Scripts -->
<script src="${pageContext.request.contextPath}/js/anychart-base.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/userCustom.js"></script>
	<script>
	var data = 
		[
		     ['广东省', '4054'],
		     ['江苏省', '9410'],
		     ['辽宁省', '6610'],
		     ['上海市', '7130'],
		     ['北京市', '8000'],
		     ['河北省', '4760'],
		     ['湖北省', '1670'],
		     ['江西省', '2670'],
		     ['天津市', '1470'],
		     ['浙江省', '2210'],
		     ['其他', '2980']
			]
	createbar("barcontent","医院省市地区分布",data)
    
        $(document).ready(function() {
            $('.footable').footable();
        });
        
        $(function(){
        	article(1)
		});
        
		function article(pageNum){
        	$.ajax({
        		url : "${pageContext.request.contextPath}/hospital/hospitallist",
        		type : "post",
        		data:{
        			pageNum: pageNum
        		},
        		success : function(res1) {
        			$('#list').html('')
        			let res = JSON.parse(res1);
        			$('#dataCount').html('共'+res.totalData+'条')
        			paging(res.totalData, res.totalPage, pageNum)
        			var list = res.list
        			for (var i = 0; i < list.length; i++) {
        				var content = list[i].content;
        				if (content && content.length > 150) {
        					content = content.substring(0, 150) + '......';
						}
        				var honor = list[i].honor;
        				if (honor && honor.length > 150) {
        					honor = honor.substring(0, 150) + '......';
						}
        				var equipment = list[i].equipment;
        				if (equipment && equipment.length > 150) {
        					equipment = equipment.substring(0, 150) + '......';
						}
        				var bus_line = list[i].bus_line;
        				if (bus_line && bus_line.length > 150) {
        					bus_line = bus_line.substring(0, 150) + '......';
						}
						var html = 
			 				"<div class='custom-article b-b'>"+
			 			    "    <div class='article-search-result'>"+
			 			    "        <div class='article-imgbox'>"+
			 			    "           <img style='width: 190px;height:140px' src='"+list[i].img_url+"'>"+
			 			    "        </div>"+
			 			    "        <div class='article-content'>"+
			 			    "        	<div class='article-content-title'>"+
			 			    "          		<a href='" + list[i].detailUrl + "' target='_blank'>" + list[i].hospital_name + "</a>"+
			 			    "            </div>"+
			 				"            <div class='article-content-con'> " + 
			 				'<div>'+
                   			'<span style="margin-right: 30px;">医院别名: '+list[i].hospital_alias+'</span>'+
                   			'<span style="margin-right: 30px;">医院等级: '+list[i].hospital_level+'</span>'+
                   			'<span style="margin-right: 30px;">医院类型: '+list[i].hospital_type+'</span>'+
                   			'<span style="margin-right: 30px;">建院年份: '+list[i].year_founded+'</span>'+
                   			'<span style="margin-right: 30px;">综合得分:  '+list[i].synthesize_score+'</span>'+
                   			'<span style="margin-right: 30px;">医疗水平: '+list[i].medical_score+'</span>'+
                   			'<span style="margin-right: 30px;">医院服务:  '+list[i].service_score+'</span>'+
                   			'</div>'+
                   			'<div>'+
                   			'<span style="margin-right: 30px;">床位数:  '+list[i].bed_num+'</span>'+
                   			'<span style="margin-right: 30px;">员工数: '+list[i].employees_num+' </span>'+
                   			'<span style="margin-right: 30px;">科室数量:  '+list[i].department_num+'</span>'+
                   			'<span style="margin-right: 30px;">门诊量(日):  '+list[i].outpatient_num+'</span>'+
                   			'<span style="margin-right: 30px;">就诊价格:  '+list[i].price_score+'</span>'+
                   		'</div>'+
                   		'<div>'+
               			'<span style="margin-right: 30px;">电话: '+list[i].phone_number+'</span>'+
               			'<span style="margin-right: 30px;">邮箱:  '+list[i].email+'</span>'+
               			'<span style="margin-right: 30px;">医院地址:  '+list[i].address+'</span>'+
               			'</div>'+
		 					" 		     </div>"+
			 				"    	</div>"+
			 				"    </div>"+
			 			    "</div>" 	
							
				                   		
					     $('#list').append(html)
					}
        			if (list.length == 0) {
        				$('#list').html('<div class="feed-element">暂无数据！</div>')
					}
        		},
        		error: function(res) {
        			$('#list').html('<div class="feed-element">暂无数据！</div>')
        		}
        	});
        }
		
        function paging(totalData,totalPage, pagenum) {
			$('#box').paging({
				initPageNo : pagenum, // 初始页码
				totalPages : totalPage, //总页数
				totalCount : '合计' + totalData + '条数据', // 条目总数
				slideSpeed : 600, // 缓动速度 单位毫秒
				jump : true, //是否支持跳转
				callback : function(page) { // 回调函数 
					}
			});
		}
        
		function JumpToPage(pageNum) {
			article(pageNum)
		}
		
		//跑马灯方法 
// 		 function init(){
// 			    //获取标题
// 			    var title=document.title;
// 			    //分割字符串--->字符数组
// 			    var arr=title.split("");
// 			    //删除第一个元素并返回该元素
// 			    var e=arr.shift();
// 			    //把一个对象添加到数组末尾
// 			    arr.push(e);
// 			    //把数组转换成字符串
// 			    var marquee=arr.join("");
// 			    //返回给浏览器
// 			    document.title=marquee;
// 			    //定时一直执行
// 			    window.setTimeout("init()",1000);
// 			}
// 			window.onload=init;
    </script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
</body>
</html>
